import React, { PureComponent } from 'react';
import { connect } from 'dva';
import DescriptionList from '../../components/DescriptionList';
import { Form, Divider, Card } from 'antd';
import Img from 'react-image';

const { Description } = DescriptionList;


@connect(({ bussiness, loading }) => ({
  bussiness,
  loading: loading.models.bussiness,
}))
@Form.create()
export default class ShowUserInfo extends PureComponent {
  componentDidMount() {
    const { dispatch } = this.props;
    dispatch({
      type: 'bussiness/info',
      payload: {
        id: this.props.data,
      },
    });
  }
  render() {
    const { bussinessInfo } = this.props.bussiness;
    console.log('bussinessInfo', bussinessInfo);
    return (
      <Card bordered={false} loading={this.props.loading}>
        <DescriptionList size="large" title="运营商" style={{ marginBottom: 32 }}>
          <Description term="名称">{bussinessInfo.bussinessName}</Description>
          <Description term="下行速度">{bussinessInfo.netSpeedsNamesTransient}</Description>
          <Description term="地区">{bussinessInfo.bussinessCityName}</Description>
          <Description term="服务区域">{bussinessInfo.districtInfoNamesTransient}</Description>
          <Description term="图片">
            <Img style={{ width: 170, height: 90 }} src={bussinessInfo.bussinessPhoto} />
          </Description>
        </DescriptionList>
        <Divider style={{ marginBottom: 32 }} />
        <DescriptionList size="large" title="发布信息" style={{ marginBottom: 32 }}>
          <Description term="创建人">{bussinessInfo.createUserNameTransient}</Description>
        </DescriptionList>
        <Divider style={{ marginBottom: 32 }} />
      </Card>
    );
  }
}
